package cn.tedu._06vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class UserRegParam {
    @Schema(description = "用户名",required=true)
//    @NotNull(message = "用户名不能为null")
//    @NotEmpty(message = "用户名不能为null和空字符串")
//    @NotBlank(message = "用户名不能为null和空字符串和空白字符串")
//    @Size(min=6,max=10,message = "用户名长度必须在6-10之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]{6,10}$",message = "用户名格式错误")
    private String username;
//    @Schema(description = "用户密码",required=true)
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?])|(?=.*[a-z])(?=.*\\d)(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?])|(?=.*[A-Z])(?=.*\\d)(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]).{8,20}$",
            // 错误提示信息（用户可见，需明确规则）
            message = "密码格式不符合要求：长度需8-20位，且至少包含大写字母、小写字母、数字、特殊符号中的3种")
    private String password;
    @Email(message = "邮箱格式错误")
    @Pattern(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",message = "邮箱格式错误")
    @Schema(description = "用户邮箱",required=true)
    private String email;
    @Pattern(regexp="^1[3-9]\\d{9}$",message = "手机号码格式错误")
    @Schema(description = "用户电话",required=true)
    private String phone;
}
